{literal}

<link type="text/css" rel="stylesheet" href="style/lightbox-form.css">
<script src="js/lightbox-form.js" type="text/javascript"></script>
<script language="javascript" src="js/contact_us.js"></script>
<link type="text/css" href="jss/tipTip.css"  rel="stylesheet"  />
<script src="jss/jquery.tipTip.js" type="text/javascript"></script>
<link type="text/css" href="style/jquery.timecalendar.css" rel="stylesheet" />
<script type="text/javascript" src="jss/jquery.timecalendar.js"></script>


<script language="javascript">
jQuery(function(){
	jQuery(".someClass").tipTip();
});

function CheckFields(formID,NumRatingCat){
   var r_comment = document.getElementById('review_comment').value;
   var NumRatingCat = NumRatingCat;	 	 	 	 
   var coach_id = document.getElementById('coach_id').value;
   var reviewed_by = document.getElementById('logged_user').value;
   
   if(document.getElementById('review_comment').value=='')
   {
    jQuery('#review_comment').css('border','1px solid #FF0000');
		return false;
   }
   else 
   jQuery('#review_comment').css('border','1px solid #ccc');
	
	var frmID='#'+formID;
	
	var params ={

		'action': 'sendreview',
		'NumCoachRatingCat': NumRatingCat,
		'IsProcess': 'Y',
		'reviewed_by': reviewed_by
	};

	var paramsObj = jQuery(frmID).serializeArray();
	
	jQuery.each(paramsObj, function(i, field){

		params[field.name] = field.value;

	});
	
   if(r_comment!='')
   {
	  jQuery.ajax({
		type: "POST",
		url: 'coachdetails.php?coach_id='+coach_id,
		data: params,
		dataType : 'text',
		success: function(data){
	     jQuery('.signin-message').fadeIn(0);
		 jQuery('#msgbox').fadeIn(0);
	     jQuery('#msgbox').html('Review posted successfully.');
	     jQuery('.signin-message').fadeOut(5000);
		 jQuery('#paging').html(data);
        }
      });
	  document.getElementById("review_comment").value='';
	  document.getElementById('serialStar').value='';
	  closebox();
	}
  }	
function submit_message_text(){	
	var message_text=jQuery('#message_text').val();
	var user_id_to=jQuery('#user_id_to').val();
	var user_id_from=jQuery('#user_id_from').val();
	var reply_of_msg=jQuery('#reply_of_msg').val();
	
	if(message_text == ""){
		jQuery('#message_text').css('border','1px solid #FF0000');
		return false;
	}	
	else{
		jQuery('#message_text').css('border','1px solid #ccc');
	
		jQuery.ajax({
			   url:'reply.php',
			   data:'flag=1&message_text='+message_text+'&reply_of_msg='+reply_of_msg+'&user_id_to='+user_id_to+'&user_id_from='+user_id_from,
			   type:'post',		  
			   success:function(resp){
			        jQuery('.signin-message').fadeIn(0);
			        jQuery('#msgbox').fadeIn(0);
					jQuery('#msgbox').html('Message sent successfully. An email notification is also sent with your message.');
					jQuery('.signin-message').fadeOut(5000);
			   } 		   
		});
		
		document.getElementById("message_text").value='';
		closereplybox();
	}
	
}

function closereply()
{
	document.getElementById("message_text").value='';
	jQuery('#message_text').css('border','1px solid #ccc');
	closereplybox();
}
function closereviewbox()
{
	document.getElementById("review_comment").value='';
	document.getElementById("serialStar").value='';
	jQuery('#review_comment').css('border','1px solid #ccc');
	closebox();
}
</script>  
{/literal}
{if $IsProcess neq 'Y'}
<div class="right-panel">
      <div class="findcoach-title" style="margin-bottom: 5px;"><!--<a href="findcoach.php"><h1 title="Find Coach"><span>Find Coach</span></h1></a>-->
        <div class="title" style="float: left;padding: 0;border: none;"><a style="text-decoration: none;" href="findcoach.php">Find Coach</a></div>
        <div class="breadcrumb">{$CoachArr.name}</div>
        <div class="clear"></div>
      </div>

	  <div class="clear"></div>
      <div class="game-list-block">
	  
		
         <div class="game-image-block">
			{if $CoachArr.photo neq ''}
		     <img src="uploaded/user_images/thumbs/big_{$CoachArr.photo}" alt="Coach" border="0" />
			{else}
			 <img src="images/coach_thumb.jpg" border="0" /> 
			{/if} 
		</div> 
		    
        <div class="game-details-block">
            <div class="score_title coachname" >
				<!--<h4 class="gameshead">{$CoachArr.name}</h4>-->
				<h2>
					<a class="{$online_status}" title="{$online_status}"></a><a href="javascript:;" class="" onclick="redirect_function({$CoachArr.user_id})" style="text-decoration:none;">{$CoachArr.name}</a> 
					<a id="{$CoachArr.user_id}_friendStar" class="{if $isfriend eq 'y'}star_friend{else}star_not_friend{/if}" title="{if $isfriend eq 'y'}in your friend list{else}not your friend list{/if}"></a>
				</h2>
				{if $smarty.session.user_id neq '' && $smarty.session.user_id neq $CoachArr.user_id}
				<div class="addAsFriendWindow">
					<a class="addAsFriendLink" href="javascript:;">Message</a><br/>
					{if $isfriend eq 'n'}
					<a class="addAsFriendLink" href="javascript:;" onclick="addAsFriend(event,'{$CoachArr.user_id}','{$CoachArr.name}')">Add as friend</a>
					{else}
					<a class="addAsFriendLink" href="javascript:;" onclick="removeFriend(event,'{$CoachArr.user_id}','{$CoachArr.name}')">Remove friend</a>
					{/if}
				</div>
				{/if}
				
			</div>
			<div class="score_card">
				<div id="scoreCard">
					<ul>
						{if $CoachOverallArr.overall_rating neq 0}
						<li id="Overall" class="tTip">
						<span class="someClass" title="{$CoachOverallArr.rating_overall_tooltip}">
						{$CoachOverallArr.overall_rating}<br/>Overall
						</span>
						</li>
						{/if}
						{section name=k loop=$CatIndividualRec}
						{if $CatIndividualRec[k].rating_category eq 'Knowledge'}
						<li id="Knowledge" class="tTip">
						<span class="someClass" title="{$CatIndividualRec[k].rating_category_tooltip}">
						{$CatIndividualRec[k].rating}<br/>{$CatIndividualRec[k].rating_category}
						</span>
						</li>
						{/if}
						{if $CatIndividualRec[k].rating_category eq 'Structure'}
					   <li id="Structure" class="tTip">
					   <span class="someClass" title="{$CatIndividualRec[k].rating_category_tooltip}">
					   {$CatIndividualRec[k].rating}<br/>Structure
					   </span>
					   </li>
					   {/if}
					   {if $CatIndividualRec[k].rating_category eq 'Communication'}
						<li id="Communication" class="tTip" style="width: 85px;">
						<span class="someClass" title="{$CatIndividualRec[k].rating_category_tooltip}">
						{$CatIndividualRec[k].rating}<br/>Communication
						</span>
						</li>
						{/if}
						{if $CatIndividualRec[k].rating_category eq 'Professionalism'}
						 <li id="Professionalism" class="tTip" style="width: 90px;">
						 <span class="someClass" title="{$CatIndividualRec[k].rating_category_tooltip}">
						 {$CatIndividualRec[k].rating}<br/>Professionalism
						 </span>
						 </li>
						 {/if}
						{/section}
					</ul>
				</div>
			</div>
			<br />

			<p class="clear"></p>
			<div class="games-desc user_details" style="margin-top: 10px;">
				<dl>
					<dt>Language:</dt>
					<dd>{$CoachArr.language}</dd>
				</dl>
				{if $CoachArr.avail_local eq 'Y'}
				<dl>
					<dt>City (Local meet-up):</dt>
					<dd>{if $CoachArr.availability_city neq ''}{$CoachArr.availability_city}{else}N/A{/if}</dd>
				</dl>
				{/if}
				<dl>
					<dt>Availability:</dt>
					<dd>{if $CoachArr.availability_type neq ''}{$CoachArr.availability_type}{else}N/A{/if}</dd>
				</dl> 
				<dl>
					<dt>Introduction:</dt>
					<dd><div>{if $CoachArr.description neq ''}{$CoachArr.description}{else}N/A{/if}</div></dd>
				</dl>
				
			</div>
			
            {section name=game loop=$CoachgameArr}
			<div class="games-desc user_details" style="margin-top: 15px;">
				<h2>{$CoachgameArr[game].game}</h2>
				<div style="margin-left: 15px;">
					{if $CoachgameArr[game].is_ladder eq 'Y'}
					<dl>
						<dt>Ladder:</dt>
						<dd>{if $CoachgameArr[game].ladder neq ''} {$CoachgameArr[game].ladder} {else} N/A {/if}</dd>
					</dl>
					{/if}
					{if $CoachgameArr[game].is_server eq 'Y'}
					<dl>
						<dt>Server:</dt>
						<dd>{if $CoachgameArr[game].server neq ''} {$CoachgameArr[game].server} {else} N/A {/if}</dd>
					</dl>
					{/if}
					{if $CoachgameArr[game].is_region eq 'Y'}
					<dl>
						<dt>Region:</dt>
						<dd>{if $CoachgameArr[game].region neq ''} {$CoachgameArr[game].region} {else} N/A {/if}</dd>
					</dl> 
					{/if}
					{if $CoachgameArr[game].is_race eq 'Y'}
					<dl>
						<dt>Race:</dt>
						<dd>{if $CoachgameArr[game].race neq ''} {$CoachgameArr[game].race} {else} N/A {/if}</dd>
					</dl> 
					{/if}
					{if $CoachgameArr[game].is_rating eq 'Y'}
					<dl>
						<dt>Rating:</dt>
						<dd>{if $CoachgameArr[game].rating neq ''} {$CoachgameArr[game].rating} {else} N/A {/if}</dd>
					</dl> 
					{/if}
					<dl>
						<dt>Experience:</dt>
						<dd><div>{if $CoachgameArr[game].experience neq ''}{$CoachgameArr[game].experience}{else}N/A{/if}</div></dd>
					</dl> 
					<dl>
						<dt>Lesson Plan:</dt>
						<dd><div>{if $CoachgameArr[game].lesson_plan neq ''}{$CoachgameArr[game].lesson_plan}{else}N/A{/if}</div></dd>
					</dl> 
					
					
					<dl>
						<dt>Rates:</dt>
						<dd>
							{if $CoachgameArr[game].rate_A neq '' or $CoachgameArr[game].rate_B neq '' or $CoachgameArr[game].rate_C neq ''}
							<div>
							{if $CoachgameArr[game].rate_A neq ''}<div>{$CoachgameArr[game].rate_A}pts / 1hr</div> {/if}
							{if $CoachgameArr[game].rate_B neq ''}<div>{$CoachgameArr[game].rate_B}pts / 2hr</div> {/if}
							{if $CoachgameArr[game].rate_C neq ''}<div>{$CoachgameArr[game].rate_C}pts / 3hr</div> {/if}
							</div>
							{else}
							N/A
							{/if}
						</dd>
					</dl>
				</div>
				
			</div>
			 {/section}
			{if $smarty.session.user_id neq '' && $smarty.session.user_id neq $CoachArr.user_id}
			
            <div class="button-flex button70"  style="margin-top:15px;margin-right:{if $smarty.session.user_type eq '2'}{if $is_fav eq '0'}10{else}7{/if}{else}0{/if}px;">
				<a href="javascript:void(0);" onClick="openbox('Review and Rating for <b>{$CoachArr.name}</b>', 1)"  class="button" style="float: right">Review</a>
			</div>
			<div class="button-flex button70" style="margin-right:{if $smarty.session.user_type eq '2'}{if $is_fav eq '0'}10{else}10{/if}{else}10{/if}px;">
				<a href="javascript:void(0);" class="button" style="float: right" onClick="openreplybox('Send message to <b>{$CoachArr.name}</b>', 1)">Message</a>
			</div>
			<div class="button-flex-big  button150"  style="margin-right:{if $smarty.session.user_type eq '2'}{if $is_fav eq '0'}10{else}7{/if}{else}0{/if}px;">
				<a href="javascript:void(0);" class="button" style="float: right" onClick="showCalendar('{$CoachArr.user_id}');">Schedule a lesson</a>
				<br /> 
			    <div class="clear"></div>
		        <div class="signin-message" style="display:none;">
                    <div id="msgbox" style="color:#0077BC;"></div>
		        </div>
			</div>  
		   {/if}
			
		</div>
        <div class="clear"></div>
	</div>
	  
	{if $Numvideo > 0}
    <div class="game-details-block game-list">
        <h2 title="Video">Videos</h2>
        <div class="clear"></div>
		{section name=video loop=$CoachvideoArr}
		 
		{assign var='i' value=$smarty.section.video.index+1}
        <div {if $i%3 eq '0'} class="games-replay-last" {else} class="games-replay" {/if}>
          
          	<div class="replay-content">
			   <a href="videodetails.php?video_id={$CoachvideoArr[video].video_id}">
			   <img src="uploaded/video_images/thumbs/mid_{$CoachvideoArr[video].video_image}" alt="" title="{$CoachvideoArr[video].video_title}" border="0"  /></a>
			</div>
			<div class="replay-content">
				<div class="replay-title"><a href="videodetails.php?video_id={$CoachvideoArr[video].video_id}">{$CoachvideoArr[video].video_title}</a><br />
					<span class="date">{$CoachvideoArr[video].video_date}<br />
					{if $CoachvideoArr[video].time_length neq ''}{$CoachvideoArr[video].time_length} min{else} N/A {/if}
					</span>
				</div>
				<div class="game-rating">
					<strong>Likes :</strong>&nbsp;{$CoachvideoArr[video].numlike}	
					<br />
					<strong>Disikes :</strong>&nbsp;{$CoachvideoArr[video].numunlike}				 
				</div>
				<div class="replay-title" style="padding-top:0px; width:90%">
					<span class="date">Game : <em>{$CoachvideoArr[video].game}</em></span>
				</div>

			</div>
			<br />
			<br />
			Views : {$CoachvideoArr[video].view_count}
		</div>
         
		  {if $i%3 eq '0'}
            <div class="clear"></div>
	      {/if}		
		 {/section}
		<div class="clear"></div> 
      </div>
	  {/if}{/if}
      <div class="clear"></div>
	<div id="paging"> 
	 <div id="review">
     <div class="review-list">
     <h2 title="Review">Reviews</h2>
	  {if $NumReview >0}
       <div class="clear"></div>
	    {section name=rrow loop=$UserReview}
		 
	    <div class="review-block">
             
			 <div class="review-left">
			 <a href="{$UserReview[rrow].userlink}">
			  <img src="{$UserReview[rrow].img}" height="92" width="105"  alt="{$UserReview[rrow].review_by}" border="0" />
			 </a>
			 </div>
			 <div class="review-right">
			 <div class="review-sub-title">
             
             	<div class="review_thumb_block">
				 <h4 class="reviewshead">Reviewed By : <a href="{$UserReview[rrow].userlink}">{$UserReview[rrow].review_by}</a></h4><br/><br />
	 			 
				 <span><em>Posted on</em></span> : {$UserReview[rrow].r_date}<br /><br />
				 {if $UserReview[rrow].review_comment neq ''}
				 <p><i>Review</i>:&nbsp;{$UserReview[rrow].review_comment|nl2br}</p><br />
				 {/if}
				</div>
                
                <div class="review_card_block">
                 <!-- Score Area -->
                <div id="scoreCard">
                    <ul>
						{if $UserReview[rrow].overall_r neq 0}
                        <li id="Overall" class="tTip">
						<span class="someClass" title="{$UserReview[rrow].rating_overall_tooltip}">
						{$UserReview[rrow].overall_r}<br/>Overall
						</span>
						</li>
						{/if}
						{section name=k loop=$UserReview[rrow].individual}
						{if $UserReview[rrow].individual[k].rating_category eq 'Knowledge'}
                        <li id="Knowledge" class="tTip">
						<span class="someClass" title="{$UserReview[rrow].individual[k].rating_category_tooltip}">
						{$UserReview[rrow].individual[k].rating}<br/>{$UserReview[rrow].individual[k].rating_category}
						</span>
						</li>
						{/if}
						{if $UserReview[rrow].individual[k].rating_category eq 'Structure'}
                       <li id="Structure" class="tTip">
					   <span class="someClass" title="{$UserReview[rrow].individual[k].rating_category_tooltip}">
					   {$UserReview[rrow].individual[k].rating}<br/>Structure
					   </span>
					   </li>
					   {/if}
					   {if $UserReview[rrow].individual[k].rating_category eq 'Communication'}
                        <li id="Communication" class="tTip" style="width: 85px;">
						<span class="someClass" title="{$UserReview[rrow].individual[k].rating_category_tooltip}">
						{$UserReview[rrow].individual[k].rating}<br/>Communication
						</span>
						</li>
						{/if}
						{if $UserReview[rrow].individual[k].rating_category eq 'Professionalism'}
                         <li id="Professionalism" class="tTip" style="width: 90px;">
						 <span class="someClass" title="{$UserReview[rrow].individual[k].rating_category_tooltip}">
						 {$UserReview[rrow].individual[k].rating}<br/>Professionalism
						 </span>
						 </li>
						 {/if}
						{/section}
                    </ul>
                </div>
                </div>
                
                <div class="clear"></div>
				<!-- Score Area END -->
                 
			 </div>
			 <!--p class="post"><span>Posted on</span> : {$UserReview[rrow].r_date}</p-->
			 </div>
			 <div class="clear"></div>
		</div>
		 
	    {/section}
      
	  {if $pagination_arr[1]}
      <div class="clear"></div>
      <div class="pagin">
         <ul>
            {$pagination_arr[1]}
         </ul>
      </div>
	  {/if}
	  {else}
	   No reviews
	  
	  
	{/if} 
	</div>
  </div>	
  </div>	 
  </div> 

<div id="shadowing"></div>
<div id="box">
  <h2><span id="boxtitle"></span></h2>
  <!--div style="font-size:14px;">Review and rating For <b>{$CoachArr.name}</b> </div-->
   <div class="review">
   <!--div id='replyMsg' style="color:#009933; font-size:14px;text-align:center; padding-bottom:5px;"></div-->
   <div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:5px;">{if $ermsg neq ''} {$ermsg}{/if} </div>
   <form name="contact" id="Rating_Coach"  method='post' action="" onsubmit="return false;">
   <input type="hidden" name="coach_id" id="coach_id" value="{$coach_id}" />
   <input type="hidden" name="logged_user" id="logged_user" value="{$logged_user}" />
   <input type="hidden" name="user_type_id" id="user_type_id" value="1" />
   <table width="100%" cellpadding="0" cellspacing="0" class="rev">
	  
	 
	   <tr>
	   <td class="tTip"><span class="someClass" title="{$CoachOverallArr.rating_overall_tooltip}">Overall :</span> </td>
	   <td>
	   <div class="kan">
	   	1&nbsp;<input type="radio" value="1" name="Rating_overall" id="serialStar" title="Poor">
		2&nbsp;<input type="radio" value="2" name="Rating_overall" id="serialStar" title="Ok">
		3&nbsp;<input type="radio" value="3" name="Rating_overall" id="serialStar" title="Good">
		4&nbsp;<input type="radio" value="4" name="Rating_overall" id="serialStar" title="Better">
		5&nbsp;<input type="radio" value="5" name="Rating_overall" id="serialStar" title="Awesome">	 
	  </div>  
		<!--<div class="comment"> <input type="text" value="" name="Comment_overall" id="Comment_overall"></div>-->
		</td>
	   </tr>
	   
		<tr>
		<td></td>
		<td>
		<br /><br />		</td>
		</tr>

       {section name=i loop=$RatingCatArr}
	   <tr>
	   	 <td class="tTip">
		 <span class="someClass" title="{$RatingCatArr[i].rating_category_tooltip}">{$RatingCatArr[i].rating_category}:</span>
		 </td>
		 <td colspan="2"> <div class="kan">
		1&nbsp;<input type="radio" value="1:{$RatingCatArr[i].rcat_id}" name="Rating_{$smarty.section.i.index}" id="serialStar" title="Poor">
		2&nbsp;<input type="radio" value="2:{$RatingCatArr[i].rcat_id}" name="Rating_{$smarty.section.i.index}" id="serialStar" title="Ok">
		3&nbsp;<input type="radio" value="3:{$RatingCatArr[i].rcat_id}" name="Rating_{$smarty.section.i.index}" id="serialStar" title="Good">
		4&nbsp;<input type="radio" value="4:{$RatingCatArr[i].rcat_id}" name="Rating_{$smarty.section.i.index}" id="serialStar" title="Better">
		5&nbsp;<input type="radio" value="5:{$RatingCatArr[i].rcat_id}" name="Rating_{$smarty.section.i.index}" id="serialStar" title="Awesome"></div><!--<div class="comment" ><input type="text" value="" name="Comment_{$smarty.section.i.index}" id="Comment_{$smarty.section.i.index}">
		<input type="hidden" value="{$RatingCatArr[i].rcat_id}" name="comment_rating_{$smarty.section.i.index}" id="comment_rating_{$smarty.section.i.index}" /></div>-->		</td>
		<tr>
		<td></td>
		<td>
		
		<br /><br />		</td>
		</tr>
	   </tr>
	   {/section}
	    <tr><td colspan="3">&nbsp;</td></tr>
	    <tr>
	   	<td width="43%" valign="top">Review :</td>
		<td width="54%"><textarea name="review_comment" id="review_comment" cols="15" rows="5" >{$Formval.user_about}</textarea></td>
	   </tr>
	   
	     <tr><td colspan="3">&nbsp;</td></tr>
	   <tr>
	   	<td colspan="3" align="center">    
		    <input name="submit" class="button" value="Submit" type="submit" onclick="return CheckFields('Rating_Coach',{$NumRatingCat})" />
            <input name="" class="button" value="Cancel" type="button" onClick="closereviewbox()" />		</td>
	   </tr>
   </table>
   
  
  </form>
  
 </div> 
</div>
<div id="shadowreply"></div>
<div id="replybox">
	<h2><span id="replytitle"></span></h2>
  	<!--div style="font-size:14px;">Message to <b>{$CoachArr.name}</b> </div-->
   	<div class="review">   
	   	<form name="contact" id="Contact"  method='post' action="" onsubmit="return false;">
		   	<fieldset> 
			   	<label>Message :</label>
			   	<textarea rows="10" cols="40"  name="message_text" id="message_text" class=""></textarea>	  
			   	<input name="flag" type="hidden" value="1" />
				<input name="user_id_to" id="user_id_to" type="hidden" value="{$CoachArr.user_id}" />
			    <input name="user_id_from" id="user_id_from" type="hidden" value="{$smarty.session.user_id}" />
			    <input name="reply_of_msg" id="reply_of_msg" type="hidden" value="0" /> 
				<p class="clear"></p>
				<label>&nbsp;</label>            
				<input name="snd_message_text" type="submit" class="button" value="Submit" onclick="return submit_message_text()"/> 
			    <input name="" class="button" value="Cancel" type="button" onClick="closereply()" />
		   	</fieldset> 
	  	</form> 
 	</div> 
</div>

